interface EnvState {
  placeInfo: any | null
  userInfo: any | null
  giftSettings: any | null
}

export const useEnvStore = defineStore('env-store', {
  state: (): EnvState => ({
    placeInfo: null,
    userInfo: null,
    giftSettings: null
  }),
  actions: {
    setPlaceInfo(info: any) {
      this.placeInfo = info
    },
    setUserInfo(info: any) {
      this.userInfo = info
    },
    setGiftSettings(cfg: any) {
      this.giftSettings = cfg
    },
    setEnv(payload: Partial<EnvState>) {
      Object.assign(this, payload)
    }
  }
})